import 'package:flutter/material.dart';
import '../../l10n/app_localizations.dart';

class ConfirmBottomView extends StatelessWidget {
  final VoidCallback onConfirm;
  final String totalPrice;
  final String symbol;

  const ConfirmBottomView({
    Key? key,
    required this.onConfirm,
    required this.totalPrice,
    required this.symbol,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 85,
      padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
      decoration: BoxDecoration(
        color: Colors.white,
        border: Border.all(color: Color(0xFFE6E6E6), width: 1),
      ),
      child: Row(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.baseline,
            textBaseline: TextBaseline.alphabetic,
            children: [
              Text(
                AppLocalizations.of(context)!.payable + ":",
                style: TextStyle(
                  color: Colors.black,
                  fontSize: 14,
                  fontWeight: FontWeight.bold,
                ),
              ),
              SizedBox(width: 5),
              Text(
                symbol + totalPrice,
                style: TextStyle(
                  color: Colors.red,
                  fontSize: 19,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ],
          ),
          Spacer(),
          Container(
            width: 150,
            height: 40,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(20),
              gradient: LinearGradient(
                colors: [Color(0xFF8A9CFF), Color(0xFF5F60EF)],
              ),
              boxShadow: [
                BoxShadow(
                  color: Color(0xFF5F60EF).withValues(alpha: 0.5),
                  offset: Offset(0, 3),
                  blurRadius: 5,
                ),
              ],
            ),
            child: ElevatedButton(
              onPressed: onConfirm,
              style: ElevatedButton.styleFrom(
                backgroundColor: Colors.transparent,
                shadowColor: Colors.transparent,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(20),
                ),
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Image.asset('assets/images/order_icon6.png', width: 15, height: 15, color: Colors.white),
                  SizedBox(width: 5),
                  Text(
                    isChineseLocale() ? AppLocalizations.of(context)!.submit + AppLocalizations.of(context)!.order : AppLocalizations.of(context)!.submit ,
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 15,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}